#pragma once

#include "my_hash.h"

namespace dzp
{
	
	template<class K,class V ,class Hash= dzp::_Hash<K>>
	class unoredred_map
	{
		struct mapkofT
		{
			const K& operator()(const std::pair<K, V>& k)
			{
				return k.first;
			}
		};
	public:
		typedef typename hash < K, std :: pair<K, V>, mapkofT, Hash > ::iterator iterator;
		iterator begin()
		{
			return _biao.begin();
		}
		iterator end()
		{
			return _biao.end();
		}

		std::pair< iterator, bool> insert(const std:: pair<K, V>& k)
		{
			return _biao.insert(k);
		}
		V& operator[](const K& k)
		{
			std::pair<iterator, bool> it = _biao.insert(std::make_pair(k,V()));
			return it.first->second;
		}

	private:
		dzp::hash < K , std :: pair<K,V> , mapkofT , Hash > _biao;
	};

}